// spu ts
import { Trademark } from '@/api/product/trademark/type'
interface ResponseData {
  code: number
  message: string
  ok: boolean
}

export interface SpuData {
  id?: number  | string
  spuName: string
  description: string
  category3Id: number | string
  tmId: number | string
  spuSaleAttrList: null | SaleAttr[]
  spuImageList: null | SpuImage[]
}

export type Records = SpuData[]

export interface HasSpuResponseData extends ResponseData {
  data: {
    records: Records
    total: number
    size: number
    current: number
    searchCount: boolean
    pages: number
  }
}

export interface AllTradeMarkData extends ResponseData {
  data: Trademark[]
}

export interface SpuImage {
  id?: number
  createTime?: string
  updateTime?: string
  spuId?: number
  imgName: string
  imgUrl: string
  name?: string
  url?:string
}

export interface SpuImgData extends ResponseData {
  data: SpuImage[]
}

export interface SaleAttrValue {
  id?: number
  createTime?: null
  updateTime?: null
  spuId?: number
  baseSaleAttrId: number | string
  saleAttrValueName: string
  saleAttrName?: string
  isChecked?: null
}
export type SpuSaleAttrValueList = SaleAttrValue[]

export interface SaleAttr {
  id?: number
  createTime?: null
  updateTime?: null
  spuId?: number
  baseSaleAttrId: number | string
  saleAttrName: string
  spuSaleAttrValueList: SpuSaleAttrValueList
  flag?: boolean
  saleAttrValue?: string,
  attrIdAndSttrValueId?:string
}

export interface SaleAttrResponseDate extends ResponseData {
  data: SaleAttr[]
}

export interface HasSaleAttr {
  id: number
  name: string
}
export interface HasSaleAttrData extends ResponseData {
  data: HasSaleAttr[]
}
